<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Help</title>
    <link rel="stylesheet" href="./css/normalize.css">
    <link rel="stylesheet" href="./css/main.css" >
    <script type="text/javascript" src="./js/jquery-1.10.2.min.js"></script>
</head>
<body>
<div id="header">

</div><!-- header -->

<div class="container">
    <div class="main-left">
        <div class="main-right">
            <div class="main">
                <div class="nav">
                    <ul>
                        <li>
                            <a id="tab" href="#">Classes</a>
                            <span class="courses-button">▼</span>
                            <ul class="courses-dd" id="tab">
                                <li><a href="#">Software Engineering</a></li>
                                <li><a href="#">Operating Systems</a></li>
                            </ul>
                        </li>
                        <li><a href="#">Schedule</a></li>
                        <li><a href="#">Help</a></li>
                    </ul>
                    <div class="usernav">
                        <a href="#" id="account-drop">
                            <img src="images/icons/user2-16.png" alt=" "/>AccountName
                            <span id="account-drop-down">▼</span>
                        </a>
                        <ul id="drop-down">
                            <li>
                                <a href="#" id="change-password">Change password</a>
                            </li>
                            <li>
                                <a href="#" id="change-email">Change email</a>
                            </li>
                            <li>
                                <a href="#" id="logout">Logout</a>
                            </li>
                        </ul>
                        <div class="clear"></div>
                    </div>
                    <div class="clear"></div>
                </div><!-- nav end-->

                <div class="content">
                    <div class="offset">
                        <div class="left">
                            <table class="crumbs">
                                <tbody>
                                <tr>
                                    <!-- change java code here -->
                                    <td class="first">
                                        <a href="#">
                                            Help
                                        </a>
                                    </td>
                                    <td>→</td>
                                    <td class="last"><em>All questions</em></td>
                                </tr>
                                </tbody>
                            </table>
                            <div class="page-left">
                                <h2 class="floatleft">All questions</h2>
                                <button class="btn-green floatright" id="add-question">
                                    <span>
                                        <a href="#">Add a question</a>
                                    </span>
                                </button>
                                <div class="clear"></div>
                                <table class="question-table">
                                    <thead>
                                    <tr>
                                        <th>
                                            Question
                                        </th>
                                        <th>
                                            Date
                                        </th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr>
                                        <td>
                                            <a href="#">My First Question</a>
                                        </td>
                                        <td>
                                            Wednesday, Dec 4th, 2013 by Chelsea Silva
                                        </td>
                                    </tr>
                                    <tr class="active">
                                        <td>
                                            <a href="#">My First Question</a>
                                        </td>
                                        <td>
                                            Wednesday, Dec 4th, 2013 by Chelsea Silva
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="right">
                        <div class="right-fade">
                            <div class="right-time">
                                <span class="time round-3">
                                    Monday, Apr 14th,
                                    <abbr id="current-time">10:14am</abbr>
                                </span>
                            </div>
                            <div class="right-classes">
                                <h2>Your classes</h2>
                                <ul class="courses_ul">
                                    <li class="course_li" id="course_123123">
                                        <a id="course_123123" class="course" href="#">
                                            Software Engineering
                                        </a>
                                    </li>
                                    <li class="course_li" id="course_123123">
                                        <a id="course_123123" class="course" href="#">
                                            Operating Systems
                                        </a>
                                    </li>
                                </ul>
                                <div class="clear"></div>
                                <a href="#">Add a class</a>
                                <div class="clear"></div>
                            </div>
                            <div class="clear"></div>
                            <div class="right-extras">
                                <h2>Support</h2>
                            </div>
                        </div>
                    </div>
                    <div class="clear"></div>
                </div>

            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div class="clear"></div>
    <div class="shadow">
    </div>
    <div class="question-popup">
        <div class="question-item">
            <label for="question-title">Question title:</label>
            <input type="text" class="input" name="question-title" id="question-title"/>
        </div>
        <div class="question-item">
            <label for="question-text">Question text:</label>
            <textarea class="input" name="question-text" rows="5" id="question-text"></textarea>
        </div>
        <div class="question-options">
            <button class="btn-green" id="question-submit">
                <span>
                    Submit question
                </span>
            </button>
            or
            <a href="#" id="question-popup-cancel">Cancel</a>
        </div>
    </div>

</div><!-- container end-->

<div id="footer">

</div>
<script src="js/jquery-main.js"></script>
<script>
    $(document).ready(function() {
        $("#add-question").click(function(ev) {
            ev.preventDefault();
            console.log("hello pop");
            var width = $(window).width();
            var height = $(window).height();
            var pop = $(".question-popup");
            var popWidth = pop.width();
            var popHeight = pop.height();
            $(".shadow").css("display", "block");
            pop.css({
                "display": "block",
                "left": (width - popWidth) / 2,
                "top": (height - popHeight) / 5,
                "z-index": 999
            });
        });
        $("#question-popup-cancel").click(function(ev) {
            ev.preventDefault();
            $(".shadow").css("display", "none");
            $(".question-popup").css("display", "none");
        });
        $("#question-submit").click(function(ev){
            ev.preventDefault();
            var title = $("#question-title").val();
            var text = $("#question-text").val();
            $.ajax({
                url : "",
                type : "POST",
                data : "command=question", //data  title text
                success : function(message) {
                    if (message == 0) {

                    }
                }
            });
            $(".shadow").css("display", "none");
            $(".question-popup").css("display", "none");
        });
    });
</script>
</body>
</html>